//货柜管理-供应商列表
App.util.ns('Admin.Cabinet.Factory');
App.pages.add((function(){
    var NS = Admin.Cabinet.Factory;
    var page = new App.Page({
        name: 'cabinet/factory/index'
    });
    //页面初始化
    page.initStack.add('dataTable', function(){
        //面包屑导航
        this.setBreadcrumb([{
            icon: '<i class="fa fa-window-restore"></i>',
            content: '货柜管理'
        }, {
            content: '厂家管理'
        }]);
        this.dataTable = new App.DataTable({
            baseUrl: '/admin/cabinet/factory',
            dataUrl: 'lists',
            table: {
                id: 'id',
                main: 0,
                columns: App.util.copy(NS.Conf.columns)
            },
            filter: [
                {type: 'keywords'},
                {type: 'timeRange'}
            ],
            menu: [
                {parent: 'add', permission: 'op:admin.cabinet.cabinetFactory.create'},
                {parent: 'view', permission: 'op:admin.cabinet.cabinetFactory.detail'},
                {parent: 'edit', permission: 'op:admin.cabinet.cabinetFactory.update'},
                {parent: 'drop', permission: 'op:admin.cabinet.cabinetFactory.delete'},
                {parent: 'multiDrop', permission: 'op:admin.cabinet.cabinetFactory.multiDelete'},
                {parent: 'oplog', permission: 'op:admin.cabinet.cabinetFactory.getOpLogs'}
            ],
            detail: {
                form: {
                    items: App.util.copy(NS.Conf.form)
                }
            }
        }, page);
        this.dataTable.fix(this.contentContainer);
        this.dataTable.loadData();
    });
    //页面刷新
    page.refreshStack.add('dataTable', function(){
        this.dataTable.loadData(true);
    });
    //页面销毁
    page.destroyStack.add('dataTable', function(){
        this.dataTable.destroy();
    });
    return page;
})());